<script>
Array.prototype.myMap = function(cb){
    let arr = this
    let newArr = []
    for(let i=0; i<arr.length; i++){
        newArr.push(cb(arr[i], i, arr))
    }
    return newArr
}

let arr = [3,1,2,34,123,5,143,2,31,435,2345]

let result = arr.myMap((item, index) => item+','+index)
console.log(result)


</script>